/* 
邓哥，81岁，爱好香菜、秋葵、遛鸟
成哥，30岁，爱好扯淡、找邓嫂
monica，17岁，爱好奶茶、唱歌

用字面量描述上面的信息

思考：
1. 如何得到平均年龄
2. 如何得到所有人所有爱好的总数
*/


var teachers = [
    { name: "邓哥", age: 81, loves: ["香菜", "秋葵", "遛鸟"] },
    { name: "成哥", age: 30, loves: ["爱好扯淡", "找邓嫂"] },
    { name: "monica", age: 17, loves: ["爱好奶茶", "唱歌"] },
]


/* 【】里面可以写字面量，变量，表达式 */

var arg = (teachers[0]["age"] + teachers[1].age + teachers[2].age) / 3
console.log(arg);


var sum = teachers[0]["loves"].length + teachers[1].loves.length + teachers[2].loves.length
console.log(sum);
